/* GUI CONVERTED from eciq06.p (converter v1.75) Mon Aug 14 12:26:50 2000 */
/* eciq06.p - PCC ROUTING INQUIRY                                       */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert eciq06.p (converter v1.00) Tue Oct 07 16:48:46 1997 */
/* web tag in eciq06.p (converter v1.00) Tue Oct 07 16:47:54 1997 */
/*K0M5*/ /*                                                    */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 8.6   DATE CREATED: 03/31/97   BY: Joe Gawel   *K08X*      */
/* REVISION: 8.6   DATE CREATED: 06/19/97   BY: Joe Gawel   *K0F9*      */
/* REVISION: 8.6  LAST MODIFIED: 06/25/97   BY: Joe Gawel   *K0F4*      */
/* REVISION: 8.6  LAST MODIFIED: 10/07/97   BY: mzv *K0M5*              */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 05/29/98   BY: *K1R7* A. Shobha */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00 BY: *N0KW* Jacolyn Neder    */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

          {mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE eciq06_p_1 "Comments"
/* MaxLen: Comment: */

&SCOPED-DEFINE eciq06_p_2 "Run Time/Batch Qty"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/*K1R7 /*K0M5*/ {wbrp02.i}*/

          {ecmtparm.i}

/*K0F4*  THE INCLUDE FILES USED FOR THIS PATCH (ECRODEF.I, ECROGET.I    */
/*K0F4*  AND ECROPUT.I) SHOULD BE REMOVED ONCE THE NEW FIELDS HAVE BEEN */
/*K0F4*  ADDED TO THE ECD2_DET TABLE IN THE SCHEMA.                     */

/*K0F4*/  {ecrodef.i}  /* ECD2_DET SIDEFILE DEFINITIONS */

          define variable comments      like mfc_logical
                                        label {&eciq06_p_1} no-undo.
          define variable ecd2routing   like ecd2_routing no-undo.
          define variable ecd2op        like ecd2_op no-undo.
/*K0F4*/  define variable batch_qty        like pt_batch no-undo.
/*K0F4*/  define variable um               like bom_batch_um no-undo.
/*K0F4*/  define variable runtime_per_batch like ro_run
/*K0F4*/                  label {&eciq06_p_2}
/*K0F4*/                  format ">>>>>>>>9.9<<<<<<<<" no-undo.

          FORM /*GUI*/ 
          {ecform15.i}
          with STREAM-IO /*GUI*/  frame form15 attr-space side-labels width 80.

          /* SET EXTERNAL LABELS */
          setFrameLabels(frame form15:handle).

          find ecm_mstr where recid(ecm_mstr) = ecm_recid no-lock no-error.
          if not available (ecm_mstr) then return.

/*K0F4*/  if can-find(first ecd2_det where ecd2_nbr = ecm_nbr) then page.

          for each ecd2_det no-lock where ecd2_nbr = ecm_nbr
          by ecd2_routing by ecd2_op on endkey undo, return with frame form15:

/*K0F4*/    {ecroget.i &nbr=ecd2_nbr
                       &routing=ecd2_routing
                       &op=ecd2_op
                       &lock=no-lock}

/*K0F4*/    batch_qty = 0.
/*K0F4*/    um = "".

            find first pt_mstr where pt_part = ecd2_routing no-lock no-error.
            if available pt_mstr then display pt_desc1 with frame form15 STREAM-IO /*GUI*/ .
            else display "" @ pt_desc1 with frame form15 STREAM-IO /*GUI*/ .
            find first wc_mstr where wc_wkctr = ecd2_wkctr and wc_mch = ecd2_mch
            no-lock no-error.
            if available wc_mstr then display wc_desc with frame form15 STREAM-IO /*GUI*/ .
            else display "" @ wc_desc with frame form15 STREAM-IO /*GUI*/ .

/*K0F4*/    find bom_mstr no-lock where bom_parent = ecd2_routing no-error.
/*K0F4*/    if available bom_mstr then do:
/*K0F4*/       batch_qty = bom_batch.
/*K0F4*/       um = bom_batch_um.
/*K0F4*/    end.
/*K0F4*/    else do:
/*K0F4*/        find pt_mstr where pt_part = ecd2_routing no-lock
/*K0F4*/             no-error.
/*K0F4*/        if available pt_mstr then do:
/*K0F4*/           if pt_bom_code = ""
/*K0F4*/              then
/*K0F4*/                 find bom_mstr no-lock where bom_parent = pt_part
/*K0F4*/                      no-error.
/*K0F4*/              else
/*K0F4*/                 find bom_mstr no-lock
/*K0F4*/                      where bom_parent = pt_bom_code
/*K0F4*/                      no-error.
/*K0F4*/           if available bom_mstr then do:
/*K0F4*/              batch_qty = bom_batch.
/*K0F4*/              um = bom_batch_um.
/*K0F4*/           end.
/*K0F4*/           else do:
/*K0F4*/              um = pt_um.
/*K0F4*/           end.
/*K0F4*/        end.
/*K0F4*/     end.

/*!K0F4*** REPLACED FOLLOWING DISPLAY ****
 *          display
 *             ecd2routing
 *             ecd2op
 *             ecd2_desc
 *             ecd2_std_op
 *             ecd2_wkctr
 *             ecd2_mch_op
 *             ecd2_men_mch
 *             edcd2_batch
 *             ecd2_run_per_b
 *             ecd2_subcntrt
 *             ecd2_sub_cost
 *             ecd2_setup_men
 *             ecd2_yield_pct
 *             ecd2_setup
 *             ecd2_run
 *             ecd2_tool
 *             ecd2_vend
 *             ecd2__qad01
 *             (if ecd2_cmtindx <> 0 then yes else no) @ comments
 *          with frame form15.
 *!K0F4*** END OF REPLACED DISPLAY ******/
/*K0F4**** NEW DISPLAY ****/
            display
              ecd2_routing @ ecd2routing
              ecd2_op @ ecd2op
              batch_qty
              um
              ecd2__qad01
              ecd2_std_op
              ecd2_wkctr
              ecd2_mch
              ecd2_desc
              ecd2_mch_op
              ecd2_milestone
              ecd2_tran_qty
              ecd2_sub_lead
              ecd2_queue
              ecd2_setup_men
              ecd2_wait
              ecd2_men_mch
              ecd2_setup
              ecd2_tool
              ecd2_run * batch_qty @ runtime_per_batch
              ecd2_run
              ecd2_vend
              ecd2_move
              ecd2_inv_value
              ecd2_yield_pct
              ecd2_sub_cost
              (if ecd2_cmtindx <> 0 then yes else no) @ comments
            with frame form15 STREAM-IO /*GUI*/ .
/*K0F4*** END OF NEW DISPLAY ****/
            down.

/*K0F9***** ADDED THE FOLLOWING SECTION *****************/
         if ecd2_cmtindx <> 0 then do:
           for each cmt_det no-lock where cmt_indx = ecd2_cmtindx
           with frame ecdcmmt attr-space side-labels width 80 row 10 overlay:
             FORM /*GUI*/ 
             cmt_seq skip
             cmt_cmmt[1] no-label
             cmt_cmmt[2] no-label
             cmt_cmmt[3] no-label
             cmt_cmmt[4] no-label
             cmt_cmmt[5] no-label
             cmt_cmmt[6] no-label
             cmt_cmmt[7] no-label
             cmt_cmmt[8] no-label
             with STREAM-IO /*GUI*/  frame ecdcmmt width 80.

             /* SET EXTERNAL LABELS */
             setFrameLabels(frame ecdcmmt:handle).

             display cmt_seq + 1 @ cmt_seq
             cmt_cmmt[1 for 8] no-label with frame ecdcmmt STREAM-IO /*GUI*/ .
             down.

             if cmt_cmmt[9] + cmt_cmmt[10] + cmt_cmmt[11] + cmt_cmmt[12]
             + cmt_cmmt[13] + cmt_cmmt[14] + cmt_cmmt[15] <> ""
             then do with frame ecdcmmt:
               display cmt_seq + 1 @ cmt_seq
               cmt_cmmt[9]  @ cmt_cmmt[1]
               cmt_cmmt[10] @ cmt_cmmt[2]
               cmt_cmmt[11] @ cmt_cmmt[3]
               cmt_cmmt[12] @ cmt_cmmt[4]
               cmt_cmmt[13] @ cmt_cmmt[5]
               cmt_cmmt[14] @ cmt_cmmt[6]
               cmt_cmmt[15] @ cmt_cmmt[7]
               with frame ecdcmmt STREAM-IO /*GUI*/ .
               down.
             end.
             
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

           end.
           hide frame ecdcmmt.
         end.
/*K0F9******* END OF ADDED SECTION *********************/
         
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

       end.
       hide frame form15.
/*K1R7 /*K0M5*/ {wbrp04.i}*/
